﻿@using System.Collections.Concurrent
@using HotelManageSystem.Models
@model HotelManageSystem.Models.DimissionModel
<script src="@Url.Content("~/Scripts/jquery-1.7.1.min.js")" type="text/javascript"></script>
<script src="@Url.Content("~/Scripts/jquery.validate.min.js")" type="text/javascript"></script>
<script src="@Url.Content("~/Scripts/jquery.validate.unobtrusive.min.js")" type="text/javascript"></script>
<link href= "@Url.Content("~/Content/TelerikGrid.css")"rel="stylesheet" type="text/css" />
<style>
    select
    {
        height: 24px;
        width: 90%;
    }
    input
    {
        height: 23px;
        width: 90%;
    }
    textarea
    {
        max-width: 90%;
        max-height: 50px;
        min-width: 90%;
        min-height: 50px;
        resize: none;
    }
</style>
<script type="text/javascript">
    $(document).ready(function () {
        //让日期选择文本框只读
        $(".t-picker-wrap>input").attr("readonly", "readonly");

        //禁用编辑
        $("#ID").attr("disabled", "disabled");
        $("#Name").attr("disabled", "disabled");
        $("#Sex").attr("disabled", "disabled");
        $("#EmployeeStatus").attr("readonly", "readonly");

        //将员工状态改为离职并不可以编辑
        $("#EmployeeStatus").attr("value", "离职状态");

        //点击返回按钮要将Dimission/Index加载到content当中来，然后设置菜单session为Biography/Index
        $("#return").click(function () {
            $.get("Dimission/Index", null, function (data) {
                $("#content").html(data);
            });
            $.post("HumanResources/SetSeesion", { u: "Dimission/Index" }, function () { });
        });
    });
</script>
<div class="t-widget t-grid" style="width: 100%; height: 100%">
    @using (Html.BeginForm("Dimission", "Dimission", FormMethod.Post))
    {
        <div class="t-edit-form-container" style="width: 100%;">
            @Html.ValidationSummary(true)
            <fieldset style="width: 100%; border: 0px;">
                <legend style="font-size: 20px;">员工离职:</legend>
                <table width="100%">
                    <tr>
                        <td>
                            <div class="editor-label">
                                @Html.LabelFor(model => model.ID)
                            </div>
                            <div class="editor-field">
                                @Html.EditorFor(model => model.ID)
                                @Html.ValidationMessageFor(model => model.ID)
                            </div>
                        </td>
                        <td>
                            <div class="editor-label">
                                @Html.LabelFor(model => model.Name)
                            </div>
                            <div class="editor-field">
                                @Html.EditorFor(model => model.Name)
                                @Html.ValidationMessageFor(model => model.Name)
                            </div>
                        </td>
                        <td>
                            <div class="editor-label">
                                @Html.LabelFor(model => model.Sex)
                            </div>
                            <div class="editor-field">
                                @Html.EditorFor(model => model.Sex)
                            </div>
                        </td>
                    </tr>
                    <tr>
                        <td>
                            <div class="editor-label">
                                @Html.LabelFor(model => model.Department)
                            </div>
                            <div class="editor-field">
                                @Html.Raw("<input id='Text1' type='text' disabled='disabled' value='" + Model.Department + "'/>")
                            </div>
                        </td>
                        <td>
                            <div class="editor-label">
                                @Html.LabelFor(model => model.Post)
                            </div>
                            <div class="editor-field">
                                @Html.Raw("<input id='Post' type='text' disabled='disabled' value='" + Model.Post + "'/>")
                            </div>
                        </td>
                        <td>
                            <div class="editor-label">
                                @Html.LabelFor(model => model.JoinTime)
                            </div>
                            <div class="editor-field">
                                @Html.Raw("<input id='JoinTime' type='text' disabled='disabled' value='" +
                                          Model.JoinTime.ToShortDateString() + "'/>")
                            </div>
                        </td>
                    </tr>
                    <tr>
                        <td>
                            <div class="editor-label">
                                @Html.LabelFor(model => model.EmployeeStatus)
                            </div>
                            <div class="editor-field">
                                @Html.EditorFor(model => model.EmployeeStatus)
                                @Html.ValidationMessageFor(model => model.EmployeeStatus)
                            </div>
                        </td>
                        <td>
                            <div class="editor-label">
                                @Html.LabelFor(model => model.DimissionDate)
                            </div>
                            <div class="editor-field">
                                @Html.EditorFor(model => model.DimissionDate)
                                @Html.ValidationMessageFor(model => model.DimissionDate)
                            </div>
                        </td>
                        <td>
                            <div class="editor-label">
                                @Html.LabelFor(model => model.DimissionRemark)
                            </div>
                            <div class="editor-field">
                                @Html.TextAreaFor(model => model.DimissionRemark)
                                @Html.ValidationMessageFor(model => model.DimissionRemark)
                            </div>
                        </td>
                    </tr>
                </table>
            </fieldset>
        </div>
        <p>
            <input type="submit" value="员工离职确认" style="height: 23px; width: 7%;" />
            <input type="button" value="返回" id="return" style="height: 23px; width: 5%;" />
        </p>
    }
</div>
